﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.ServiceModel;
using Microsoft.ServiceModel.Samples;

namespace WCFCall
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string address = "http://zhangh-pc:81/IISService/Service.svc";
            ChannelFactory<ICalculator> factory =
                new ChannelFactory<ICalculator>(
                    new WSHttpBinding(),
                    new EndpointAddress(
                        new Uri(address)));
            ICalculator proxy = factory.CreateChannel();
            double v = proxy.Add(1, 2);
            v = proxy.Divide(100, 1000);

        }
    }
}
